package com.szqhyxj.youxiangju.biz.plan;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

public class PlanDetail implements Parcelable {

    @SerializedName("totalAmount")
    private BigDecimal totalAmount;

    @SerializedName("workingAmount")
    private BigDecimal workingAmount;

    @SerializedName("shouldEndAt")
    private long shouldEndAt;

    @SerializedName("planId")
    private String planId;

    @SerializedName("payCostTotal")
    private BigDecimal payCostTotal;

    @SerializedName("cardNo")
    private String cardNo;

    @SerializedName("repayFeeTotal")
    private BigDecimal repayFeeTotal;

    @SerializedName("planLength")
    private int planLength;

    @SerializedName("tasks")
    private List<TasksItem> tasks;

    @SerializedName("status")
    private int status;

    @SerializedName("bankName")
    private String bankName;

    public BigDecimal getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getWorkingAmount() {
        return workingAmount;
    }

    public void setWorkingAmount(BigDecimal workingAmount) {
        this.workingAmount = workingAmount;
    }

    public long getShouldEndAt() {
        return shouldEndAt;
    }

    public void setShouldEndAt(long shouldEndAt) {
        this.shouldEndAt = shouldEndAt;
    }

    public String getPlanId() {
        return planId;
    }

    public void setPlanId(String planId) {
        this.planId = planId;
    }

    public BigDecimal getPayCostTotal() {
        return payCostTotal;
    }

    public void setPayCostTotal(BigDecimal payCostTotal) {
        this.payCostTotal = payCostTotal;
    }

    public String getCardNo() {
        return cardNo;
    }

    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }

    public BigDecimal getRepayFeeTotal() {
        return repayFeeTotal;
    }

    public void setRepayFeeTotal(BigDecimal repayFeeTotal) {
        this.repayFeeTotal = repayFeeTotal;
    }

    public int getPlanLength() {
        return planLength;
    }

    public void setPlanLength(int planLength) {
        this.planLength = planLength;
    }

    public List<TasksItem> getTasks() {
        return tasks;
    }

    public void setTasks(List<TasksItem> tasks) {
        this.tasks = tasks;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getBankName() {
        return bankName;
    }

    public void setBankName(String bankName) {
        this.bankName = bankName;
    }

    public String getFailMsg() {
        return failMsg;
    }

    public void setFailMsg(String failMsg) {
        this.failMsg = failMsg;
    }

    @SerializedName("failMsg")
    private String failMsg;


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeSerializable(this.totalAmount);
        dest.writeSerializable(this.workingAmount);
        dest.writeLong(this.shouldEndAt);
        dest.writeString(this.planId);
        dest.writeSerializable(this.payCostTotal);
        dest.writeString(this.cardNo);
        dest.writeSerializable(this.repayFeeTotal);
        dest.writeInt(this.planLength);
        dest.writeTypedList(this.tasks);
        dest.writeInt(this.status);
        dest.writeString(this.bankName);
        dest.writeString(this.failMsg);
    }

    public PlanDetail() {
    }

    protected PlanDetail(Parcel in) {
        this.totalAmount = (BigDecimal) in.readSerializable();
        this.workingAmount = (BigDecimal) in.readSerializable();
        this.shouldEndAt = in.readLong();
        this.planId = in.readString();
        this.payCostTotal = (BigDecimal) in.readSerializable();
        this.cardNo = in.readString();
        this.repayFeeTotal = (BigDecimal) in.readSerializable();
        this.planLength = in.readInt();
        this.tasks = in.createTypedArrayList(TasksItem.CREATOR);
        this.status = in.readInt();
        this.bankName = in.readString();
        this.failMsg = in.readString();
    }

    public static final Creator<PlanDetail> CREATOR = new Creator<PlanDetail>() {
        @Override
        public PlanDetail createFromParcel(Parcel source) {
            return new PlanDetail(source);
        }

        @Override
        public PlanDetail[] newArray(int size) {
            return new PlanDetail[size];
        }
    };
}